package com.gzl.b2b.demo.controller;

import com.gzl.b2b.demo.entity.Demo;
import com.gzl.b2b.demo.service.DemoService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @version 1.0, 2019/4/22
 */
@RestController
@RequestMapping("demo")
public class DemoController {

    private Logger log = LoggerFactory.getLogger(DemoController.class);

    @Autowired
    private DemoService demoService;

    @GetMapping("findByNameLike")
    public void findByNameLike(String name){
        log.info("findByNameLike  begin~~~~~~~~");
        List<Demo> demos = demoService.findByNameIsLike(name);
        log.info("demos ==================" + demos.size());
        log.info("findByNameLike  end~~~~~~~~");
    }
}
